﻿@model IEnumerable<GSLMS.Entity.TB_APP_REFREGINFO>
@{
    Layout = null;
    ViewBag.ViewTitle = "申请登记";
    int i = 1;
    var SearchParma = ViewData["SearchParma"] as GSLMS.Entity.TB_APP_REFREGINFO ?? new GSLMS.Entity.TB_APP_REFREGINFO();
    //SearchParma.StarDateTime = DateTime.Now.AddMonths(-1);
    //SearchParma.EndDateTime = DateTime.Now;    
}
<form id="pagerForm" method="get" action="DianDang/Apply/RefRegInfo/index?action=page&OpID=@ViewData["OperateID"]">
<input type="hidden" name="pageNum" value="1" />
<input type="hidden" name="numPerPage" value="@ViewData["pageSize"]" />
<input type="hidden" name="RowCount" value="@ViewData["RowCount"]" />
<input type="hidden" name="CUSTNAME" value="@SearchParma.CUSTNAME" />
<input type="hidden" name="StarDateTime" value="@SearchParma.StarDateTime" />
<input type="hidden" name="EndDateTime" value="@SearchParma.EndDateTime" />
<input type="hidden" name="STATUS" value="@SearchParma.STATUS" />
</form>
<div class="pageHeader">
    <form onsubmit="return navTabSearch(this)" id="Form_@ViewData["CurrentController"]" action="DianDang/Apply/RefRegInfo/index?action=search&OpID=@ViewData["OperateID"]"
    method="post">
    <div class="searchBar">
        <table class="searchContent">
            <tr>
                <td>
                    客户名称：
                </td>
                <td>
                    @Html.TextBox("CUSTNAME", SearchParma.CUSTNAME, new { @style="width:100px"})
                </td>
                <td>
                    申请日期：
                </td>
                <th>
                    @Html.TextBox("StarDateTime", SearchParma.StarDateTime, new { @class = "date", @style = "width:70px", format = "yyyy-MM-dd", @maxDate = "%y-%M-%d", @readonly = "true", formatDate = "yyyy-MM-dd" })
                </th>
                <th>
                    ~
                    @Html.TextBox("EndDateTime", SearchParma.EndDateTime, new { @class = "date", @style = "width:70px", format = "yyyy-MM-dd", @maxDate = "%y-%M-%d", @readonly = "true", formatDate = "yyyy-MM-dd" })
                </th>
                <td align="right">
                    <div class="subBar">
                        <ul>
                            <li>
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <button type="submit" name="submit">
                                            检索</button></div>
                                </div>
                            </li>
                            <li>
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <button type="reset" name="reset">
                                            重置</button></div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    </form>
</div>
<div class="pageContent">
    @Html.Partial("Buttons")
    <table class="list"  layouth="120" id="tableRefRegInfoList">
        <thead>
            <tr class="header">
                <th style="width:135px;">
                    客户名称
                </th>
                <th style="width:100px;">
                    转介人
                </th>
                <th style="width:80px;">
                    申请日期
                </th>
                <th style="width:100px;">
                    转出部门
                </th>
                <th style="width:100px;">
                    转入部门
                </th>
                <th style="width:80px;">
                    转入时间
                </th>
                <th style="width:80px;">
                    后续业务员
                </th>
            </tr>
        </thead>
        @foreach (var item in Model)
        {            
            <tr target="RefRegInfo_id" rel="@item.ID" Status="@item.STATUS">
                <td>
                    @item.CUSTNAME
                </td>
                <td style="text-align:center;">
                    @item.REFBY
                </td>
                <td style="text-align:center;">
                    <span formatdate="yyyy-MM-dd">@item.APPDATE</span>
                </td>
                <td style="text-align:center;">
                    @item.OUTDEPNAME
                </td>
                <td style="text-align:center;">
                    @item.INDEPNAME
                </td>
                <td style="text-align:center;">
                    <span formatdate="yyyy-MM-dd">@item.INTIME</span>
                </td>
                <td style="text-align:center;">
                    @item.SALESMAN
                </td>
            </tr>
            i += 1;
        }
    </table>
</div>
@Html.Partial("PageBar")
<script>
    function UpdateRefRegInfo(obj) {
        $this = $(obj);
        var selectedObj = $("#tableRefRegInfoList").find(".selected");
        var id = selectedObj.attr("rel");
        if (id) {
            var status = selectedObj.attr("Status");
            if (status == 0) {
                var url = "DianDang/Apply/RefRegInfo/Create/"+id;               
                $.pdialog.open(url, "DianDang_Apply_RefRegInfo_3", "编辑转介申请", {});
            }
            else
            { alertMsg.error("此转介申请已经提交，不允许再编辑!"); }
        }
        else {
            alertMsg.error("请选择一条记录!");
        }
        return false;
    }
</script>
